all:
	make henkaku
	make gamesd
	make menu
	make exploit

exploit:
	cd payload; make; cp payload.bin ../payload.bin

henkaku:
	cd taiHEN; mkdir build; cd build; cmake ..; make; cp taihen.skprx ../../bootstrap/res/taihen.skprx
	cd plugin; mkdir build; cd build; cmake ..; make; cp henkaku.skprx ../../bootstrap/res/henkaku.skprx; cp henkaku.suprx ../../bootstrap/res/henkaku.suprx

gamesd:
	cd gamecard-microsd/driver; mkdir build; cd build; cmake ..; make; cp gamesd.skprx ../../../bootstrap/res/gamesd.skprx

menu:
	cd bootstrap; mkdir build; cd build; cmake ..; make; xxd -i bootstrap.self > ../../payload/bootstrap.h

clean:
	-rm -rf taiHEN/build
	-rm -rf plugin/build
	-rm -rf gamecard-microsd/driver/build
	-rm -rf bootstrap/build
	-rm bootstrap/res/taihen.skprx
	-rm bootstrap/res/henkaku.skprx
	-rm bootstrap/res/henkaku.suprx
	-rm bootstrap/res/gamesd.suprx
	-rm payload/bootstrap.h
	-rm payload.bin
	cd payload; make clean
